#pragma once
#include <iostream>
#include <sstream>
#include <string>

class Punct_stream
{
public:
    Punct_stream(std::istream &source) : source(source), sensitive(true) {}
    void whitespace(const std::string &s) { white = s; }
    void add_white(char c) { white += c; }
    bool is_whitespace(char c) const;
    void case_sensitive(bool b) { sensitive = b; }
    bool is_case_sensitive() const { return sensitive; }
    virtual Punct_stream &operator>>(std::string &s);
    operator bool() const;

protected:
    std::istream &source;
    std::istringstream buffer;
    std::string white;
    bool sensitive;
};